Skip to content

feat(fragindex): phase 1 — data structures + codecs#21

Closed
ypriverol wants to merge 6 commits intodevfrom
feat/frag-index-phase1
Closed

feat(fragindex): phase 1 — data structures + codecs#21
ypriverol wants to merge 6 commits intodevfrom
feat/frag-index-phase1

Conversation

@ypriverol
Copy link
Copy Markdown
Member

Summary

Phase 1 of the fragment-indexed two-tier search design (spec at /Users/yperez/.claude/plans/msgfplus-fragment-index/design.md). Internal-only — adds the data-structure foundation with full unit-test coverage. No CLI surface, no runtime behaviour change.

Safe to merge as a no-op addition; Phases 2-7 build on top.

What landed

Commit Component
540f194 EliasFano stub + empty-list codec
e4b01d6 EliasFano naive int[] encoding
4c7e68f EliasFano.Cursor zero-copy iterator
f129d55 Fingerprint128 128-bit b/y bit-set + popcount
e450891 Slab (immutable view) + SlabBuilder (writable, single-use)
276fe08 FragmentIndexStore interface + DirectStore in-memory impl

All six commits are individually revertible.

Files

New package edu.ucsd.msjava.fragindex:

  • EliasFano.java — sorted-int[] codec with zero-copy Cursor iteration. Naive layout; compact Elias-Fano bit-packing lands in Phase 4.
  • Fingerprint128.java — 128-bit fragment fingerprint, low-64 = b-ion bits, high-64 = y-ion bits. setBIonBucket / setYIonBucket / popcountAnd.
  • Slab.java — immutable read-only per-slab view. fingerprint(int) returns a fresh snapshot (no internal-state leak); fingerprintLoBits/HiBits for zero-allocation reads; bucketCursor(int) returns EliasFano.Cursor.
  • SlabBuilder.java — writable construction buffer. Single-use (IllegalStateException after finish()).
  • FragmentIndexStore.java — storage backend interface.
  • DirectStore.java — in-memory impl of the store.

Test plan

  • mvn -B verify — 184 tests pass (166 baseline + 18 new Phase 1 tests)
  • No change to existing DBScanner / MSGFPlus / scoring code paths
  • No new CLI flags; no behaviour change on dev
  • All Phase 1 test files are self-contained; no dependency on CompactSuffixArray or other external state

Reviews

Each task went through spec compliance review + code quality review:

  • Task 6 (Slab + SlabBuilder) initially flagged two Must-fix issues by reviewer (mutable Fingerprint128 return leaked internal state; SlabBuilder not idempotent). Both addressed in the same commit.
  • Task 7 reviewer flagged a Javadoc clarification on concurrent-build thread-safety (deferred to Phase 2 when the build pipeline is added).

Not in this PR

Phase 2 (build pipeline via extended BuildSA -buildFragIndex 1) will be its own PR on top. See /Users/yperez/.claude/plans/msgfplus-fragment-index/plan.md for the 7-phase plan; Phase 1 is gated on this PR merging.

🤖 Generated with Claude Code

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 18, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 26e397f6-64eb-4583-affe-520675fe0140

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/frag-index-phase1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ypriverol ypriverol closed this Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant